package com.Design.Chain.old;

import com.Design.Chain.Request;

/**
 * @Author Lc
 * @Date 2023/9/29
 * @PackageName: com.Design.Chain
 * @ClassName: Manager
 * @Description:
 */

public class Manager {
    public String name;

    public Manager(String name) {
        this.name = name;
    }

    public void getResult(String mangerLevel, Request request){
        if(mangerLevel.equals("经理")){
            if(request.getRequestType().equals("请假") && request.getNumber() <= 2){
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，被批准");
            }else {
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，无法批准");
            }
        }else if(mangerLevel.equals("总监")){
            if(request.getRequestType().equals("请假") && request.getNumber() <= 5){
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，被批准");
            }else {
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，无法批准");
            }
        } else if(mangerLevel.equals("总经理")){
            if(request.getRequestType().equals("请假") && request.getNumber() <= 10){
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，被批准");
            }else {
                System.out.println(this.name + ":" + request.getMessage() + "数量" + request.getNumber() + "天，无法批准");
            }
        }
    }
}
